USE [BMIG_MENSUAL_POST_CADENA]

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_M0009_TELEFONO'
	   AND 	  type = 'P') 
	DROP PROCEDURE [dbo].[WASP_M0009_TELEFONO]
GO

CREATE PROCEDURE [dbo].[WASP_M0009_TELEFONO] AS
begin   
    SELECT  ctnro
          , MAX(dotelf) AS tel1
    INTO	dbo.ingreso_produccion_numero_telefono_ant
    FROM  dbo.FSR006(nolock) AS FSR006_1
    GROUP BY ctnro
END
